import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      // name: 'HelloWorld',
      redirect: '/login'
    },
    {
      path: '/login',
      name: 'Login',
      components: {
        'subPage': resolve => require(['../components/login/login.vue'], resolve)
      }
    },
    {
      path: '/home',
      name: 'Home',
      component: resolve => require(['../components/home/home.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/newdetail/:newsid',
      name: 'NewsDetail',
      component: resolve => require(['../components/home/newsDetail.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/branch',
      name: 'Branchs',
      component: resolve => require(['../components/home/branch/branch.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/branchinfo/:branchid',
      name: 'BranchInfo',
      component: resolve => require(['../components/home/branch/branchInfo.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/lesson',
      component: resolve => require(['../components/home/lessons/lessonStatus.vue'], resolve),
      children: [{
        path: '/',
        name: 'Lesson',
        component: resolve => require(['../components/home/lessons/lesson.vue'], resolve),
        meta: {
          requiresAuth: true
        }
      }]
    },
    {
      path: '/home/lesson/branch/:branchid',
      name: 'BranchLesson',
      component: resolve => require(['../components/home/lessons/branchLesson.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/lesson/:lessonid',
      name: 'LessonDetail',
      component: resolve => require(['../components/home/lessons/lessonDetail.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/help',
      component: resolve => require(['../components/home/takeHelp/helpStatus.vue'], resolve),
      children: [{
        path: '/',
        name: 'TakeHelp',
        component: resolve => require(['../components/home/takeHelp/help.vue'], resolve),
        meta: {
          requiresAuth: true
        }
      }]
    },
    {
      path: '/home/help/add',
      name: 'AddHelp',
      component: resolve => require(['../components/home/takeHelp/add.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/help/:helpid',
      name: 'HelpDetail',
      component: resolve => require(['../components/home/takeHelp/helpDetail.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/help/branch/:branchid',
      name: 'BranchHelp',
      component: resolve => require(['../components/home/takeHelp/branchHelp.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/help/person/:personid',
      name: 'PersonHelp',
      component: resolve => require(['../components/home/takeHelp/personHelp.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/fees',
      name: 'Fees',
      component: resolve => require(['../components/home/fees/fees.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/fees/person/:branchid',
      name: 'PersonFees',
      component: resolve => require(['../components/home/fees/personFees.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/home/integral',
      component: resolve => require(['../components/home/integral/integralStatus.vue'], resolve),
      children: [{
        path: '/',
        component: resolve => require(['../components/home/integral/integral.vue'], resolve),
        meta: {
          requiresAuth: true
        }
      }]
    },
    {
      path: '/home/infos',
      name: 'Infos',
      component: resolve => require(['../components/home/infos.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/develop',
      component: resolve => require(['../components/developing/developStatus.vue'], resolve),
      children: [{
        path: '',
        component: resolve => require(['../components/developing/develop.vue'], resolve),
        meta: {
          requiresAuth: true
        }
      }]
    },
    {
      path: '/develop/apply/:personid/:status',
      name: 'Apply',
      component: resolve => require(['../components/developing/apply.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/demonstrate',
      component: resolve => require(['../components/demonstrate/demoStatus.vue'], resolve),
      children: [{
        path: '/',
        component: resolve => require(['../components/demonstrate/demo.vue'], resolve),
        meta: {
          requiresAuth: true
        }
      }]
    },
    {
      path: '/demonstrate/person/:personid',
      name: 'PersonDemo',
      component: resolve => require(['../components/demonstrate/personDemo.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/demonstrate/detail/:demoid',
      name: 'DemoDetail',
      component: resolve => require(['../components/demonstrate/demoDetail.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/theme',
      name: 'Theme',
      component: resolve => require(['../components/theme/theme.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/theme/detail/:themeid',
      name: 'ThemeDetail',
      component: resolve => require(['../components/theme/themeDetail.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user',
      component: resolve => require(['../components/user/Home.vue'], resolve),
    },
    {
      path: '/user/config',
      component: resolve => require(['../components/user/Config.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/contact',
      component: resolve => require(['../components/user/Contact.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/info',
      component: resolve => require(['../components/user/Info.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/info/pledge',
      component: resolve => require(['../components/user/info/Pledge.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/config/changepassword',
      component: resolve => require(['../components/user/config/Changepassword.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/contact/branch/:departmentid',
      name: 'ContactBranch',
      component: resolve => require(['../components/user/contact/Branch.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/contact/member/:memberid',
      name: 'MemberInfo',
      component: resolve => require(['../components/user/contact/Member.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/fee/:cardid',
      name: 'Fee',
      component: resolve => require(['../components/user/Fee.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/point/:userid',
      component: resolve => require(['../components/user/Point.vue'], resolve),
      name: 'Point',
      meta: {
        requiresAuth: true
      }
    },
    {
      path: '/user/voice',
      component: resolve => require(['../components/user/Voice.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      name:'Recording',
      path: '/user/recording/recording',
      component: resolve => require(['../components/user/recording/recording.vue'], resolve),
      meta: {
        requiresAuth: true
      }
    },
    {
      name:'Details',
      path: '/user/recording/applicationdetails:detailsid',
      component: resolve => require(['../components/user/recording/appDetail.vue'], resolve)
    }
  ]
})
